﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: "Product Reviews".Localize()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="title">
        <%:"Reviews".Localize() %></h3>
    <div class="command clearfix">
    </div>
    <div class="table-container">
        <table>
            <thead>
                <tr>
                    <th>
                        <%:"Product".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Rate".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Customer".Localize() %>
                    </th>
                    <th class="common">
                        <%:"Date".Localize() %>
                    </th>
                    <th class="action">
                        <%:"Status".Localize() %>
                    </th>
                    <th class="action">
                        <%:"View".Localize() %>
                    </th>
                    <th class="action">
                        <%:"Delete".Localize() %>
                    </th>
                </tr>
            </thead>
            <tbody id="review-container">
            </tbody>
        </table>
        <%: Html.Partial("Pager",ViewData["Pager"] as PagerModel) %>
    </div>
    <div class="hide">
        <table id="review-row">
            <tbody>
                <tr class="template">
                    <td>
                        <a href="#" target="_blank">Demo product</a>
                    </td>
                    <td>
                        5 Points
                    </td>
                    <td>
                        <a href="#" target="_blank">Guest</a>
                    </td>
                    <td>
                        2011-01-21 15:30
                    </td>
                    <td class="action">
                        <div class="o-icon tick" title="Published">
                            Published</div>
                        <div class="o-icon cross" title="Unpublished">
                            Unpublish</div>
                    </td>
                    <td class="action">
                        <a href="#view-dialog" class="o-icon view dialog-link" title="View">
                            <%:"View".Localize() %></a>
                    </td>
                    <td class="action">
                        <form action='<%= ViewData["delete_action"] %>' method="post" class="delete-form">
                        <a href="#" class="o-icon delete delete-link" message='<%= "Are you sure you want to delete this review?".Localize() %>'
                            title="Delete">
                            <%:"Delete".Localize() %></a>
                        <input type="hidden" name="Id" />
                        </form>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="dialog" id="view-dialog" title="Review" style="height: 300px; width: 600px;">
            <div class="common-form">
                <fieldset>
                    <table>
                        <tbody>
                            <tr>
                                <th>
                                    <label>
                                        Product</label>
                                </th>
                                <td>
                                    <a href="#" target="_blank" class="product">Demo product</a>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Rate</label>
                                </th>
                                <td class="rate">
                                    5 Points
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Customer</label>
                                </th>
                                <td>
                                    <a href="#" target="_blank" class="customer">Guest</a>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Date</label>
                                </th>
                                <td class="date">
                                    2011-01-25 00:00:00
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Remark</label>
                                </th>
                                <td class="remark">
                                    <p>
                                        Remarks here</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </fieldset>
                <form action='<%= ViewData["publish_action"] %>' method="post" class="publish-form">
                <div class="buttons">
                    <button type="submit">
                    <span class="publish">
                        <%:"Publish".Localize() %></span><span class="unpublish"><%:"UnPublish".Localize() %></span>
                        </button>

                </div>
                <input type="hidden" class="id" name="Id" />
                </form>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
var Reviews = <%= ViewData["Reviews"] %>;

    </script>
    <%using (var loader = ClientLoader.RegisterInstance())
      {
          loader.Require("productreview.index.js");
      } %>
</asp:Content>
